﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using System.Transactions;

namespace Data
{
    public class ProductRepository : DbBase
    {
        public void Insert(Product entity)
        {

            using (TransactionScope trans = new TransactionScope())
            {
                try
                {
                    base.Insert<Product_Comment>(entity.Product_Comment, false);
                    base.Insert<Review>(entity.Review);
                    trans.Complete();
                }
                catch (Exception)
                {

                    throw;
                }
                finally
                {
                    trans.Dispose();
                }

            }
        }
    }

    public class Product_CommentRepository : DbBase
    { }
}
